package com.aldobucchi.graph.query.adapters
{
	

	import com.aldobucchi.graph.query.IQueryTarget;
	import com.aldobucchi.graph.query.Query;
	
	

	public class PropertySpec
	{
		
		
		public var arcs:Array;
		
		public var limit:int=1;
		
		public var name:String;
		
		public var adapterFunc:Function;
		
		

		public function PropertySpec( name:String, arcs:Array, limit:int=1, adapterFunc:Function=null )
		{
			this.name = name;
			this.arcs = arcs;
			this.limit = limit;
			this.adapterFunc = adapterFunc;
		}

		
		
		public function buildQuery( node:*, target:IQueryTarget=null, priority:uint=5 ):Query
		{
			var q:Query = Query.forPath( node, arcs, target, priority );							
			q.limit = limit;
			return q;			
		}


	}

}